package com.stone.mpandroidchartdemo;

import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;

import java.text.DecimalFormat;

/**
* @description:  Y轴的自定义格式
* @author  Stone
* @date 10/23/18 9:32 PM
* @version V1.0
*/
public class StoneYAxisValueFormatter implements IAxisValueFormatter{

    private DecimalFormat mFormat;

    public StoneYAxisValueFormatter() {
        mFormat = new DecimalFormat("###,###,###,##0.0");
    }

    @Override
    public String getFormattedValue(float value, AxisBase axis) {
        return mFormat.format(value);
    }
}
